#!/bin/bash
#
#H1-------------------R1---------------H2
ip netns add H1
ip netns add R1
ip netns add H2

#H1
ip link add name H1_R1 type veth peer name R1_H1
ip link set H1_R1 netns H1
ip netns exec H1 bash -c \
'
	ip link set lo up
	ip link set H1_R1 up
'

#R1
ip link add name R1_H2 type veth peer name H2_R1
ip link set R1_H2 netns R1
ip link set R1_H1 netns R1
ip netns exec R1 bash -c \
'
	ip link set lo up
	ip link set R1_H2 up
	ip link set R1_H1 up
'

#H2
ip link set H2_R1 netns H2
ip netns exec H2 bash -c \
'
	ip link set lo up
	ip link set H2_R1 up
'
